package com.ck.company.service;

import com.ck.exception.ServiceException;
import com.ck.model.common.PictureGroup;
import com.ck.model.company.dto.PictureGroupTreeDTO;
import com.ck.model.company.dto.ProgramPictureGroupTreeDTO;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * 图片分组Service
 *
 * @author dxy
 * @date 2018/7/4 11:51
 */
public interface CpPictureGroupService {
	/**
	 * 保存图片组
	 *
	 * @param pictureGroup PictureGroup
	 * @param request      HttpServletRequest
	 */
	void savePictureGroup(PictureGroup pictureGroup, HttpServletRequest request);

	/**
	 * 修改图片组
	 *
	 * @param pictureGroup PictureGroup
	 * @param request      HttpServletRequest
	 */
	void updatePictureGroup(PictureGroup pictureGroup, HttpServletRequest request);

	/**
	 * 删除图片组
	 *
	 * @param pictureGroupId 图片组ID
	 * @param request        HttpServletRequest
	 */
	void deletePictureGroupById(Long pictureGroupId, HttpServletRequest request) throws ServiceException;

	/**
	 * 获取公司的分组树列表
	 *
	 * @param companyCode 商家编码
	 * @return List<PictureGroupTreeDTO>
	 */
	List<PictureGroupTreeDTO> listPictureGroupTree(String companyCode) throws ServiceException;

	/**
	 * 通过名称查找图片组
	 *
	 * @param companyCode      商家编码
	 * @param pictureGroupName 图片组名称
	 * @return PictureGroup
	 */
	PictureGroup getPictureGroupByName(String companyCode, String pictureGroupName) throws ServiceException;

	/**
	 * 通过编码获取图片组
	 *
	 * @param companyCode      商家编码
	 * @param pictureGroupCode 图片组编码
	 * @return PictureGroup
	 */
	PictureGroup getPictureGroupByCode(String companyCode, String pictureGroupCode) throws ServiceException;

    /**
     * 查询图片组集合
     *
     * @param companyCode    商家编码
     * @param pictureGroupId 图片组ID
     * @return List<ProgramPictureGroupTreeDTO>
     * @throws ServiceException
     */
    List<ProgramPictureGroupTreeDTO> listProgramPictureGroupTree(String companyCode, Long pictureGroupId) throws ServiceException;

	/**
	 * 根据图片分组ID查询单个分组
	 * @param companyCode 商家编号
	 * @param pictureGroupId 图片分组ID
	 * @return ProgramPictureGroupTreeDTO
	 * @throws ServiceException
	 */
    ProgramPictureGroupTreeDTO getPictureGroupTreeById(String companyCode, Long pictureGroupId) throws ServiceException;

	/**
	 * 查询图片组集合
	 *
	 * @param companyCode    商家编码
	 * @param pictureGroupId 图片组ID
	 * @return List<ProgramPictureGroupTreeDTO>
	 * @throws ServiceException
	 */
    List<ProgramPictureGroupTreeDTO> treePictureGroupForProgram(String companyCode, Long pictureGroupId) throws ServiceException;
}
